import { useEffect, useState } from 'react';
import http from '../../api/index'
import { Tag } from 'antd';
function Index() {
  const [list,setList]=useState([])
  const tges=()=>{
    http.get('/api/tag/list').then(res=>{
      console.log(res.data);
      setList(res.data)
    })
  }
  useEffect(()=>{
    tges()
  },[])
  return (
    <div>
      {
        list.map((item,index)=>{
          return <Tag color={[
            'magenta',
            'red',
            'volcano',
            'orange',
            'gold',
            'lime',
            'green',
            'cyan',
            'blue',
            'geekblue',
            'purple',
            'pink',
          ] [index % 10]} key='index'>{item.name}</Tag>
        })
      }
    </div>
  )
}

export default Index
